
*********************************************************************
*Ms: Selective Attention: The United Nations Security Council and Armed Conflict
*Authors: Magnus Lundgren & Mark Klamberg
*Date: August 2022
*Software: Stata 17
*Hardware: Mac
*Data available via Harvard Dataverse
*********************************************************************

*********************************************************************

** Install additional programs 

net install http://www.stata-journal.com/software/sj18-3/gr0073/
ssc install grstyle, replace
ssc install palettes, replace
ssc install colrspace
ssc install coefplot, replace


**Graph Settings

grstyle clear
set scheme s2color
grstyle init
grstyle set plain, box
grstyle color background white
grstyle set color Set1
grstyle yesno draw_major_hgrid yes
grstyle yesno draw_major_ygrid yes
grstyle color major_grid gs8
grstyle linepattern major_grid dot
grstyle color ci_area gs12%50
grstyle clockdir legend_position 6
grstyle numstyle legend_cols 1
grstyle linestyle legend none




* FIGURES IN ARTICLE (Note that some figures are created in R, using a separate do-file)

* Figure 3


use "~/Dropbox/unsc_agenda_data_dec10_2021_standardized.dta", clear 
gen time_sq = time*time
gen time_cube = time*time*time
drop if ccode==.
duplicates report ccode year
duplicates list ccode year
duplicates drop ccode year, force

xtset ccode year 

xtlogit agenda_binary  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted i.pko i.incompatibility_f wdi_pop vdem_libdem wdi_gdpcapcon2010 time time_sq time_cube, re 
estimates store m1

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted i.pko i.incompatibility_f wdi_pop vdem_libdem wdi_gdpcapcon2010 time time_sq time_cube, re 
estimates store m2

coefplot m1 m2, drop(_cons p5_trade_prop  wdi_pop _cons time time_sq time_cube) xline(0) xsize(1) ysize(1.5) ylabel(,labsize(*0.7)) mcolor(black) ciopts(lcolor(black)) p1 ( keep (refugees_total_log)) p2( msymbol(circle) drop(wdi_pop _cons time time_sq time_cube)) coeflabels(bd_best_log = "Battle deaths" best_fatality_estimate_log ="Civilian fatalities" refugees_total_log="Refugees" mean_s_p5_weighted="Mean P5 s-score" p5_trade_prop="P5 trade" p5_tot_arms_exp_mean ="P5 arms exports" p5_contig= "P5 contiguity" sd_s_p5_weighted="P5 interest heterogeneity" vdem_libdem = "Liberal democracy index" wdi_gdpcapcon2010="GDP/capita" 1.pko="Peacekeeping operation" 2.incompatibility_f="Incompability concerning government") headings(refugees_total_log = "{bf:Conflict severity}" mean_s_p5_weighted ="{bf:P5 interests}"  1.pko ="{bf:Controls}") 


* Figure 4 

use "~/Dropbox/unsc_agenda_data_dec10_2021.dta", clear
gen time_sq = time*time
gen time_cube = time*time*time
drop if ccode==.
duplicates report ccode year
duplicates list ccode year
duplicates drop ccode year, force
xtset ccode year 
gen bd_best_1000 = bd_best/1000
gen refugees_total_mil= refugees_total/1000000
gen best_fatality_estimate_1000 =best_fatality_estimate/1000

xtlogit agenda_binary  bd_best_1000 best_fatality_estimate_1000 refugees_total_mil mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 

margins, at(bd_best=(0(2)50)) 

marginsplot, recast(line) plot1opts(lcolor(black) lwidth(thick)) ciopt(color(black%20)) recastci(rarea) title("Placement on UNSC Agenda, Predicted Probabilities", size(medsmall)) xtitle("Battle Deaths (1,000s)",size(medsmall)) ytitle("Pr(UNSC Agenda)", size(medsmall)) yscale(range(0 1)) ylabel(0(0.2)1) xlabel(0(10)50)


* Figure 6

use "~/Dropbox/unsc_agenda_data_dec10_2021_standardized.dta", clear 
gen time_sq = time*time
gen time_cube = time*time*time
drop if ccode==.
duplicates report ccode year
duplicates list ccode year
duplicates drop ccode year, force
xtset ccode year 

xtlogit agenda_binary bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted i.pko i.incompatibility_f wdi_pop vdem_libdem wdi_gdpcapcon2010 time time_sq time_cube if year<2005, re 
estimates store m2

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop i.pko i.incompatibility_f vdem_libdem wdi_gdpcapcon2010 time time_sq time_cube if year>2004, re 
estimates store m3

coefplot (m2,label(1989-2004) offset(0.15) msymbol(circle)) (m3, label(2005-2019) offset(-0.15) msymbol(square)), drop(   wdi_pop _cons time time_sq time_cube) xline(0) coeflabels(bd_best_log = "Battle deaths" best_fatality_estimate_log ="Civilian fatalities" refugees_total_log="Refugees" mean_s_p5_weighted="Mean P5 s-score" p5_trade_prop="P5 trade" p5_tot_arms_exp_mean ="P5 arms exports" p5_contig= "P5 contiguity" sd_s_p5_weighted="P5 preference heterogeneity" vdem_libdem = "Liberal democracy index" wdi_gdpcapcon2010="GDP/capita" 1.pko="Peacekeeping operation" 2.incompatibility_f="Incompability concerning government") headings(bd_best_log = "{bf:Conflict severity}" mean_s_p5_weighted ="{bf:P5 interests}"  1.pko ="{bf:Controls}")  xsize(1) ysize(1.5) ylabel(,labsize(*0.7)) xlabel(,labsize(*0.7)) legend(size(small) row(3)) mcolor(black) ciopts(lcolor(black) xscale (range(-10(5)10)))


* Figure 7

xtlogit agenda_binary s_US s_UK s_RUS s_CHN p5_trade_prop p5_contig p5_primary_secondary  vdem_libdem pko incompatibility_f time time_sq time_cube, re 
estimates store m1

xtlogit agenda_binary mean_s_p5_weighted US_trade_prop UK_trade_prop FRA_trade_prop RUS_trade_prop CHN_trade_prop p5_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re
estimates store m2

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop us_exp uk_exp fr_exp rus_exp chn_exp p5_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m3
estat vce, corr

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop US_contig UK_contig FRA_conti RUS_contig CHN_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m4

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop us_aid_prop2 uk_aid_prop fra_aid_prop p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re
estimates store m5

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop UK_colony FRA_colony RUS_colony   vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m6

coefplot (m1,label(S-scores) msymbol(circle)) (m2,label(Trade importance) msymbol(square)) (m3, label(Arms exports) msymbol(triangle)) (m4, label(Contiguity) msymbol(diamond)) (m5, label(ODA) msymbol(Sh)) (m6, label(Colonial links) msymbol(Dh)), drop(mean_s_p5_weighted p5_trade_prop p5_primary_secondary p5_contig wdi_pop _cons  wdi_pop vdem_libdem wdi_gdpcapcon2010 pko incompatibility_f time time_sq time_cube) xline(0) rename(s_US = US s_UK = UK s_FRA = FRA s_RUS = RUS s_CHN = CHN US_trade_prop = US UK_trade_prop = UK FRA_trade_prop = FRA RUS_trade_prop = RUS CHN_trade_prop = CHN us_exp=US uk_exp = UK fr_exp=FRA rus_exp = RUS chn_exp = CHN us_aid_prop2 = US uk_aid_prop = UK fra_aid_prop = FRA RUS_contig=RUS CHN_contig=CHN UK_colony=UK FRA_colony=FRA RUS_colony=RUS)  xsize(1) ysize(1.5) ylabel(,labsize(*0.7)) xlabel(,labsize(*0.7)) legend(size(small) row(5)) sort mcolor(black) ciopts(lcolor(black))



* Figure 8 

use "~/Dropbox/unsc_agenda_data_dec10_2021.dta", clear
gen time_sq = time*time
gen time_cube = time*time*time
drop if ccode==.
duplicates report ccode year
duplicates list ccode year
duplicates drop ccode year, force
xtset ccode year 
gen bd_best_1000 = bd_best/1000
gen refugees_total_mil= refugees_total/1000000
gen best_fatality_estimate_1000 =best_fatality_estimate/1000

xtlogit agenda_binary  bd_best_1000 best_fatality_estimate_1000 refugees_total_mil mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 

margins, at(sd_s_p5_weighted=(0(0.05).5))

marginsplot, recast(line) plot1opts(lcolor(black) lwidth(thick)) ciopt(color(black%20)) recastci(rarea) title("Placement on UNSC Agenda, Predicted Probabilities", size(medsmall)) xtitle("P5 preference heterogeneity (sd of P5 s-scores)",size(medsmall)) ytitle("Pr(UNSC Agenda)", size(medsmall)) yscale(range(0 1)) ylabel(0(0.2)1) xlabel(0(.1).5)




* ONLINE APPENDIX

* Table A1
use "~/Dropbox/unsc_agenda_data_dec10_2021.dta", clear

estpost summarize agenda_binary agenda bd_best_log best_fatality_estimate_log refugees_total_log mean_s_p5_weighte mean_s_p5 mean_kappa_p5 p5_trade_prop p5_tot_arms_exp_mean p5_contig p5_contig p5_primary_secondary sd_s_p5_weighted s_US s_UK s_RUS s_CHN US_trade_prop UK_trade_prop FRA_trade_prop RUS_trade_prop CHN_trade_prop  us_exp uk_exp fr_exp rus_exp chn_exp US_contig UK_contig FRA_conti RUS_contig CHN_contig UK_colony FRA_colony RUS_colony  pko incompatibility_f wdi_pop vdem_libdem wdi_gdpcapcon2010 

esttab , cells("count mean(fmt(3)) sd(fmt(3)) min(fmt(3)) max(fmt(3))") noobs b(a2) 
esttab using tabA1.rtf, cells("count mean(fmt(3)) sd(fmt(3)) min(fmt(3)) max(fmt(3))") noobs 


* Table A2

use "~/Dropbox/unsc_agenda_data_dec10_2021_standardized.dta", clear 
gen time_sq = time*time
gen time_cube = time*time*time
drop if ccode==.
duplicates report ccode year
duplicates list ccode year
duplicates drop ccode year, force
xtset ccode year 

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m1

xtlogit agenda_binary bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year<2005, re 
estimates store m2

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year>2004, re 
estimates store m3

xtlogit agenda_binary  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m4

xtlogit agenda_binary bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year<2005, re 
estimates store m5

xtlogit agenda_binary  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year>2004, re 
estimates store m6


esttab m1 m2 m3 m4 m5 m6, se b(2) sca(rho sigma_u)
esttab m1 m2 m3 m4 m5 m6 using tabA2.rtf, se replace b(2) sca(rho sigma_u)


* Figure A3

xtlogit agenda_binary i.region_f
margins i.region_f
marginsplot, recast(bar) plotopts(barw(.6) bc(navy%20)) ylabel(,labsize(*0.8)) xlabel(,labsize(*0.8)) 


* Table A3

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean  sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f  if region=="Sub-Saharan Africa", re 
estimates store m1

xtlogit agenda_binary  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean  sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f if region=="Sub-Saharan Africa", re 
estimates store m2

esttab m1 m2, se b(2) sca(rho sigma_u)
esttab m1 m2 using tabA3.rtf, se replace b(2) sca(rho sigma_u)


* Table A4

xtlogit agenda_binary s_US s_UK s_RUS s_CHN p5_trade_prop p5_contig p5_primary_secondary  vdem_libdem pko incompatibility_f time time_sq time_cube, re 
estimates store m1 

xtlogit agenda_binary mean_s_p5_weighted US_trade_prop UK_trade_prop FRA_trade_prop RUS_trade_prop CHN_trade_prop p5_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re
estimates store m2

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop us_exp uk_exp fr_exp rus_exp chn_exp p5_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m3
estat vce, corr

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop US_contig UK_contig FRA_conti RUS_contig CHN_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m4

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop us_aid_prop2 uk_aid_prop fra_aid_prop p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re
estimates store m5

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop UK_colony FRA_colony RUS_colony   vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m6

esttab m1 m2 m3 m4 m5 m6, se replace b(2) sca(rho sigma_u)
esttab m1 m2 m3 m4 m5 m6 using tabA4.rtf, se replace b(2) sca(rho sigma_u)



* Table A5

xtnbreg agenda  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m1

xtnbreg agenda  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m2

esttab m1 m2, se b(2)
esttab m1 m2 using tabA5.rtf, se replace b(2) sca(rho sigma_u)


* Table A6

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted time time_sq time_cube, re 
estimates store m1

xtlogit agenda_binary bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted time time_sq time_cube if year<2005, re 
estimates store m2

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted time time_sq time_cube if year>2004, re 
estimates store m3

xtlogit agenda_binary  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted time time_sq time_cube, re 
estimates store m4

xtlogit agenda_binary bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted time time_sq time_cube if year<2005, re 
estimates store m5

xtlogit agenda_binary  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted time time_sq time_cube if year>2004, re 
estimates store m6


esttab m1 m2 m3 m4 m5 m6, se b(2) sca(rho sigma_u)
esttab m1 m2 m3 m4 m5 m6 using tabA6.rtf, se replace b(2) sca(rho sigma_u)


* Table A7

xtlogit agenda_binary s_US s_UK s_RUS s_CHN p5_trade_prop p5_contig p5_primary_secondary time time_sq time_cube, re 
estimates store m1 

xtlogit agenda_binary mean_s_p5_weighted US_trade_prop UK_trade_prop FRA_trade_prop RUS_trade_prop CHN_trade_prop p5_contig p5_primary_secondary  time time_sq time_cube, re
estimates store m2

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop us_exp uk_exp fr_exp rus_exp chn_exp p5_contig p5_primary_secondary time time_sq time_cube, re 
estimates store m3

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop US_contig UK_contig FRA_conti RUS_contig CHN_contig p5_primary_secondary time time_sq time_cube, re 
estimates store m4

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop us_aid_prop2 uk_aid_prop fra_aid_prop p5_primary_secondary time time_sq time_cube, re
estimates store m5

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop UK_colony FRA_colony RUS_colony time time_sq time_cube, re 
estimates store m6

esttab m1 m2 m3 m4 m5 m6, se replace b(2) sca(rho sigma_u)
esttab m1 m2 m3 m4 m5 m6 using tabA7.rtf, se replace b(2) sca(rho sigma_u)


* Table A8

xtreg agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m1

xtreg agenda_binary bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year<2005, re 
estimates store m2

xtreg agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year>2004, re 
estimates store m3

xtreg agenda_binary  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m4

xtreg agenda_binary bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year<2005, re 
estimates store m5

xtreg agenda_binary  bd_best_log  refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year>2004, re 
estimates store m6


esttab m1 m2 m3 m4 m5 m6, se b(2) sca(rho sigma_u)
esttab m1 m2 m3 m4 m5 m6 using tabA8.rtf, se replace b(2) sca(rho sigma_u)



* Table A9

xtreg agenda_binary s_US s_UK s_RUS s_CHN p5_trade_prop p5_contig p5_primary_secondary  vdem_libdem pko incompatibility_f time time_sq time_cube, re 
estimates store m1

xtreg agenda_binary mean_s_p5_weighted US_trade_prop UK_trade_prop FRA_trade_prop RUS_trade_prop CHN_trade_prop p5_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re
estimates store m2

xtreg agenda_binary mean_s_p5_weighted p5_trade_prop us_exp uk_exp fr_exp rus_exp chn_exp p5_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m3
estat vce, corr

xtreg agenda_binary mean_s_p5_weighted p5_trade_prop US_contig UK_contig FRA_conti RUS_contig CHN_contig p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m4

xtreg agenda_binary mean_s_p5_weighted p5_trade_prop us_aid_prop2 uk_aid_prop fra_aid_prop p5_primary_secondary  vdem_libdem  pko incompatibility_f time time_sq time_cube, re
estimates store m5

xtreg agenda_binary mean_s_p5_weighted p5_trade_prop UK_colony FRA_colony RUS_colony   vdem_libdem  pko incompatibility_f time time_sq time_cube, re 
estimates store m6
esttab m1 m2 m3 m4 m5 m6, se replace b(2) sca(rho sigma_u)
esttab m1 m2 m3 m4 m5 m6 using tabA9.rtf, se replace b(2) sca(rho sigma_u)


* Table A10

xtlogit agenda_binary  l1.bd_best_log  l1.best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m1

xtlogit agenda_binary l1.bd_best_log  l1.best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year<2005, re 
estimates store m2

xtlogit agenda_binary  l1.bd_best_log  l1.best_fatality_estimate_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year>2004, re 
estimates store m3

xtlogit agenda_binary  l1.bd_best_log  l1.refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m4

xtlogit agenda_binary l1.bd_best_log  l1.refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year<2005, re 
estimates store m5

xtlogit agenda_binary  l1.bd_best_log  l1.refugees_total_log mean_s_p5_weighte p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube if year>2004, re 
estimates store m6


esttab m1 m2 m3 m4 m5 m6, se b(2) sca(rho sigma_u)
esttab m1 m2 m3 m4 m5 m6 using tabA10.rtf, se replace b(2) sca(rho sigma_u)


* Table A11

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5_weighted p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m1

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_p5 p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m2

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_kappa_p5 p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f time time_sq time_cube, re 
estimates store m3

esttab m1 m2 m3, se b(2)
esttab m1 m2 m3 using tabA11.rtf, se replace b(2) sca(rho sigma_u)


* Table A12

xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log mean_s_e10_weighted mean_s_p5_weighted p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f  time time_sq time_cube, re 
estimates store m1
	
xtlogit agenda_binary  bd_best_log  best_fatality_estimate_log p5_e10_s_diff mean_s_p5_weighted p5_trade_prop p5_tot_arms_exp_mean p5_contig sd_s_p5_weighted wdi_pop vdem_libdem wdi_gdpcapcon2010 i.pko i.incompatibility_f  time time_sq time_cube, re 
estimates store m2
	
esttab m1 m2, se b(2)
esttab m1 m2 using tabA12.rtf, se replace b(2) sca(rho sigma_u)


* Tables A13-A18 (coefficients in tables are produced in separate tests)

xtlogit agenda_binary s_US s_UK s_RUS s_CHN p5_trade_prop p5_contig p5_primary_secondary  vdem_libdem pko incompatibility_f time time_sq time_cube, re 

lincom s_US - s_CHN
lincom s_US - s_UK
lincom s_US - s_RUS
lincom s_CHN - s_US
lincom s_CHN - s_UK
lincom s_CHN - s_RUS
lincom s_UK - s_CHN
lincom s_UK - s_RUS

xtlogit agenda_binary mean_s_p5_weighted US_trade_prop UK_trade_prop FRA_trade_prop RUS_trade_prop CHN_trade_prop p5_contig p5_primary_secondary  time time_sq time_cube, re

lincom US_trade_prop - CHN_trade_prop
lincom US_trade_prop - UK_trade_prop
lincom US_trade_prop - FRA_trade_prop
lincom US_trade_prop - RUS_trade_prop
lincom CHN_trade_prop - UK_trade_prop
lincom CHN_trade_prop - FRA_trade_prop
lincom CHN_trade_prop - RUS_trade_prop
lincom UK_trade_prop - FRA_trade_prop
lincom UK_trade_prop - RUS_trade_prop
lincom FRA_trade_prop - RUS_trade_prop

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop us_exp uk_exp fr_exp rus_exp chn_exp p5_contig p5_primary_secondary time time_sq time_cube, re 

lincom us_exp - chn_exp
lincom us_exp - uk_exp
lincom us_exp - fr_exp
lincom us_exp - rus_exp
lincom chn_exp - uk_exp
lincom chn_exp - fr_exp
lincom chn_exp - rus_exp
lincom uk_exp - fr_exp
lincom uk_exp - rus_exp
lincom fr_exp - rus_exp

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop US_contig UK_contig FRA_conti RUS_contig CHN_contig p5_primary_secondary time time_sq time_cube, re 

lincom RUS_contig - CHN_contig

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop us_aid_prop2 uk_aid_prop fra_aid_prop p5_primary_secondary time time_sq time_cube, re

lincom us_aid_prop2 - uk_aid_prop
lincom us_aid_prop2 - fra_aid_prop
lincom uk_aid_prop - fra_aid_prop

xtlogit agenda_binary mean_s_p5_weighted p5_trade_prop UK_colony FRA_colony RUS_colony time time_sq time_cube, re 

lincom UK_colony - FRA_colony
lincom UK_colony - RUS_colony
lincom FRA_colony - RUS_colony


* Table A19


use "~/Dropbox/unsc_agenda_data_dec10_2021.dta", clear
gen time_sq = time*time
gen time_cube = time*time*time
drop if ccode==.
duplicates report ccode year
duplicates list ccode year
duplicates drop ccode year, force
xtset ccode year 

xtlogit agenda_binary mean_s_p5_weighted US_trade_prop UK_trade_prop FRA_trade_prop RUS_trade_prop CHN_trade_prop p5_contig p5_primary_secondary  time time_sq time_cube, re

margins, at(US_trade_prop=(0 0.01) CHN_trade_prop=(0 0.01))


